﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using JeanFish.Data.Common;

namespace JeanFish.Data.Tracing
{
    public class TracingProviderServices:DbProviderServices
    {
        static TracingProviderServices()
        {
        }
        public TracingProviderServices()
        {
        }
        public static TracingProviderServices Instance { get; private set; }

        protected override string DefaultProviderName
        {
            get
            {
                //from configuration.
                return "OriginalProvider";
            }
        }
        protected override string ProviderName
        {
            get
            {
                return "TracingProvider";
            }
        }
        public override DbCommandDefinition CreateCommandDefinition(System.Data.Common.DbCommandDefinition commandDefinition, System.Data.Common.CommandTrees.DbCommandTree commandTree)
        {
            return new DbCommandDefinition(commandDefinition, commandTree, (cmd, def) => new TracingCommand(cmd, def));
        }
    }
}
